﻿// <copyright file="SamlSubjectIdentifiers.cs" company="SharpSTS">
// Copyright (c) 2007, 2008 All Right Reserved, http://sharpsts.com/
//
// This source is subject to the Microsoft Permissive License.
// Please see the License.txt file for more information.
// All other rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY 
// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// </copyright>
// <author>Barry Dorrans</author>
// <email>barryd@idunno.org</email>
// <date>2008-06-16</date>
// <summary>Provides a list of SAML subject name identifiers.</summary>

namespace SharpSTS
{
    using System.Collections.Generic;

    /// <summary>
    /// Provides a list of SAML subject name identifiers.
    /// </summary>
    internal sealed class SamlSubjectIdentifiers : Dictionary<SamlNameIdentifier, string>
    {
        /// <summary>
        /// Gets the name identifiers.
        /// </summary>
        /// <value>The name identifiers.</value>
        public static IDictionary<SamlNameIdentifier, string> Identifiers
        {
            get
            {
                return Nested.Instance;
            }
        }

        /// <summary>
        /// Single instance of subject identifiers.
        /// </summary>
        private static class Nested
        {
            /// <summary>
            /// A list of SAML Name Identifiers and their subjects.
            /// </summary>
            internal static readonly SamlSubjectIdentifiers Instance = new SamlSubjectIdentifiers
                                {
                                    {
                                        SamlNameIdentifier.Unspecified,
                                        "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"
                                    },
                                    {
                                        SamlNameIdentifier.EmailAddress,
                                        "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
                                    },
                                    {
                                         SamlNameIdentifier.X509SubjectName,
                                         "urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName"
                                    },
                                    {
                                        SamlNameIdentifier.WindowsDomainQualifiedName,
                                        "urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName"
                                    },
                                    {
                                        SamlNameIdentifier.Kerberos,
                                        "urn:oasis:names:tc:SAML:2.0:nameid-format:kerberos"
                                    },
                                    {
                                        SamlNameIdentifier.Entity,
                                        "urn:oasis:names:tc:SAML:2.0:nameid-format:entity"
                                    },
                                    {
                                        SamlNameIdentifier.Persistent,
                                        "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"
                                    },
                                    {
                                        SamlNameIdentifier.Transient,
                                        "urn:oasis:names:tc:SAML:2.0:nameid-format:transient"
                                    }
                                };
        }
    }
}
